● Zion Boggan
repos/Stepping App/apps/web/src/app/api/trpc/[trpc]/route.ts
zionboggan.com ↗
13 lines · typescript
History for this file →
1
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
2
import { appRouter, createContext } from "@stepping/api";
3
 
4
function handler(req: Request) {
5
  return fetchRequestHandler({
6
    endpoint: "/api/trpc",
7
    req,
8
    router: appRouter,
9
    createContext: () => createContext({ headers: req.headers }),
10
  });
11
}
12
 
13
export { handler as GET, handler as POST };